package com.fengyun.scala

import scala.io.StdIn

/**
 * @author Hanpeng
 * @date 2021/1/24 16:25
 * @description:
 *                objectConsole extends DeprecatedConsole with AnsiColor
 *                可以实现在终端上打印Scala value的功能 以及从终端上读取特定值，
 *                定义了在 ANSI terminal 定义常量来标记文本
 */
object TestConsole {

  def main(args: Array[String]): Unit = {
    println("dfd")
    println(Console.GREEN)
    //def err: PrintStream 可以被覆盖 setErr
    // def flush(): Unit Flushes the output stream.
    //def in: BufferedReader can be overridden by setIn
    //def out: PrintStream can be overridden by setOut
    //def withErr[T](err: OutputStream)(thunk: ⇒ T): T
    println("请输入姓名");
    val name: String = StdIn.readLine()
    println("请输入年龄")
    val age: Int = StdIn.readInt()
    println("请输入薪水")
    val sal: Double = StdIn.readDouble()
    printf("用户的信息为 name=%s age=%d sal=%f",name,age,sal)



  }

}
